<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.利用循环和定时器，每秒钟输出起始值++的数
        
        for (i = 1; i <= 5; i++) {
            (function fun1(i) {
                (setTimeout(function fun2() {
                    console.log(i)
                },i * 1000))
            })(i)
        }



        // function fn() {
        //     var a = 10;
        //     function fn2() {
        //         a++;
        //         console.log(a)
        //     }
        //     return fn2;
        //     }
        // let newFn = fn() // === fn2
        // newFn()
        // newFn()

        
    </script>
</body>
</html>